<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{:$i->title}</title>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/admin.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="wrapper">
  <div class="title shadow titleBg">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><h1> {:$i->title} <span>[<a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/add/0/{:$i->categoryId}/{:$i->channelId}">添加</a>] [<a href="#@" onclick="updateHtml(0);">全部更新</a>]</span></h1></td>
      </tr>
    </table>
  </div>
  <div class="title shadow">
    <table width="100%" border="0" cellspacing="1">
      <tr>
        <td><form action="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/" method="get">
        ID:<input class="keyWord" name="id" type="text" value="{:$i->keyWord.id}" size="8" /> 
        标题:<input class="keyWord" name="title" type="text" value="{:$i->keyWord.title}" size="20" /> 
        <input name="" value="搜 索" type="submit" /> 
        <input name="" type="reset" value="清 除" onclick="$('.keyWord').each(function(){this.value = '';});return false;" /> 
        <input name="" type="reset" value="全 部" onclick="window.location.href='{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/';return false;" />
        </form></td>
      </tr>
    </table>
  </div>    
  <div class="content shadow">
    <table width="100%" border="0" cellspacing="1">
      <tr class="titleBg">
        <th scope="col">#ID</th>
        <th scope="col" width="40">选择</th>
        <th class="textL" scope="col">页面标题</th>
        <th scope="col">修改时间</th>
        <th scope="col">操作</th>
      </tr>
      {:foreach item=item from=$i->lists}<tr>
        <td>{:$item->id}</td>
        <td><input name="sel[]" type="checkbox" value="{:$item->id}" class="noBorder" /></td>
        <td class="textL"><a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">{:$item->title}</a></td>
        <td>{:$item->updateTime|date_format:"%Y-%m-%d %H:%M"}</td>
        <td>
        <a href="{:$smarty.const.ROOT_DIR}/io.php/data/single/{:$item->id}" target="_blank">动态访问</a> | <a href="{:$smarty.const.ROOT_DIR}{:$item->fileName}" target="_blank">静态访问</a> | <a href="#@" onclick="updateHtml({:$item->id});">更新</a>
         | <a href="{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/mod/{:$item->id}">修改</a>
         | <a onclick="del({:$item->id});return false;" href="#@">删除</a></td>
      </tr>{:/foreach}       
      <tr>
        <td colspan="5" class="lightGreyBg textL"> <a href="#@" onclick="selAll('sel[]');">全选</a> | <a href="#@" onclick="selAnti('sel[]');">反选</a> | <a href="#@" onclick="del(0,'sel[]');">删除</a> | <a href="#@" onclick="updateHtml(-1);">更新</a> | {:$i->pagesCode}</td>
      </tr>
    </table>
  </div>
</div>
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/tooltip.css" rel="stylesheet" type="text/css" />
<link href="{:$smarty.const.PUBLIC_DIR}/common/style/ui.all.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.core.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.draggable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.resizable.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/ui.dialog.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/jquery.tooltip.js"></script>
<script language="javascript" type="text/javascript" src="{:$smarty.const.PUBLIC_DIR}/common/js/common.js"></script>
<script language="javascript" type="text/javascript">
function batPass(status)
{
	var ids = '';
	$("input[name='sel[]']").each(function(i){
		if(this.checked)
		{
			if(ids == '')
			{
				ids=this.value;
			}
			else
			{
				ids+=','+this.value;
			}
		}
	});
	if(ids.length==0)
	{
		alert('您还没有选中要进行处理的记录');
		return false;
	}	
	
	if(confirm('确定要批量审核ID为'+ids+'的记录?'))
	{
		getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+ids+'/'+status, '{:$i->curUrl}');
	}
}

function updateHtml(id)
{
	if(id == -1)
	{
		id = getSel('sel[]');
		if(id == '')
		{
			alert('您还没有选中要更新的记录');	
			return false;
		}
	}
	getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/updateHtml/'+id);	
}

function setPass(id,status)
{
	if(status == 1)
	{
		$("#set"+id).html('<span class="deepGrey">【已通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/2\');" href="#">不通过</a>】');
	}
	else if(status == 2)
	{
		$("#set"+id).html('<span class="deepGrey">【未通过】 =></span> 【<a onclick="return getDialog(\'{:$smarty.const.BOOT_URL}/{:$i->c}/setPass/'+id+'/1\');" href="#">通过</a>】');
	}
}

function del(id, name)
{
	var ids='';
	
	if(name != undefined)
	{
		$("input:checked[name='"+name+"']").each(function(i){
			ids+=this.value+',';
		});
		ids = ids.substr(0,ids.length-1);
	}
	else if(id > 0)
	{
		ids = id;
	}
	
	if(ids.length==0)
	{
		alert('您还没有选中要删除的记录');
		return false;
	}
	
	if(confirm('确定要删除ID为'+ids+'的记录?'))
	{
		getDialog('{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/del/'+ids, '{:$smarty.const.BOOT_URL}/{:$i->c}/{:$i->m}/lists/0/{:$i->p[2]}/{:$i->p[3]}');
	}
	
	return false;
}
</script>
</body>
</html>
